import { get, post } from '@/utils/request'
const BASE_URL = window.baseUrl
// 获取配置信息
export function getConfig() {
  return post(BASE_URL + '/system/clean/getConfig')
}

// 保存配置信息
export function saveConfig(query) {
  return post(BASE_URL + '/system/clean/saveConfig?time=' + query)
}

//  获取备份列表
export function getBackupsList(data) {
  return get(BASE_URL + '/system/backups/backupsList', data)
}

// 恢复备份
export function rollbackBackups(query) {
  return post(BASE_URL + '/system/backups/rollback?id=' + query)
}

//  删除备份
export function deleteBackups(query) {
  return post(BASE_URL + '/system/backups/delete?id=' + query)
}

//  获取数据库列表
export function getDatabaseList() {
  return get(BASE_URL + '/system/backups/getDatabaseNames')
}

// 生成备份
export function mysqlBackups(query) {
  return post(BASE_URL + '/system/backups/mysqlBackups?databaseNames=' + query)
}
